package com.gill.jwt.config;

import com.gill.jwt.config.properties.JwtProperties;
import com.gill.jwt.util.JwtUtil;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: my-utils-repo
 * @description:
 * @author: Gill
 * @create: 2021-03-22 12:12
 **/
@Configuration
public class JwtConfig {

    @Bean
    @ConfigurationProperties(prefix = "jwt")
    public JwtProperties jwtProperties(){
        return new JwtProperties();
    }

    @Bean
    public JwtUtil jwtUtil(){
        return JwtUtil.getInstance(jwtProperties());
    }
}
